package com.bootdo.system.service.impl;

import com.bootdo.system.dao.DlPositionClassDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.system.dao.DlPositionSubclassDao;
import com.bootdo.system.domain.DlPositionSubclassDO;
import com.bootdo.system.service.DlPositionSubclassService;



@Service
public class DlPositionSubclassServiceImpl implements DlPositionSubclassService {
	@Autowired
	private DlPositionSubclassDao dlPositionSubclassDao;
	@Autowired
	private DlPositionClassDao dlPositionClassDao;

	@Override
	public DlPositionSubclassDO get(Integer positionSubclassId){
		return dlPositionSubclassDao.get(positionSubclassId);
	}
	
	@Override
	public List<DlPositionSubclassDO> list(Map<String, Object> map){
		List<DlPositionSubclassDO> list = dlPositionSubclassDao.list(map);
		for (DlPositionSubclassDO dlPositionSubclassDO : list) {
			dlPositionSubclassDO.setPositionClassTitle(dlPositionClassDao.get(dlPositionSubclassDO.getPositionClassId()). getTitle());
		}

		return list;
	}
	
	@Override
	public int count(Map<String, Object> map){
		return dlPositionSubclassDao.count(map);
	}
	
	@Override
	public int save(DlPositionSubclassDO dlPositionSubclass){
		return dlPositionSubclassDao.save(dlPositionSubclass);
	}
	
	@Override
	public int update(DlPositionSubclassDO dlPositionSubclass){
		return dlPositionSubclassDao.update(dlPositionSubclass);
	}
	
	@Override
	public int remove(Integer positionSubclassId){
		return dlPositionSubclassDao.remove(positionSubclassId);
	}
	
	@Override
	public int batchRemove(Integer[] positionSubclassIds){
		return dlPositionSubclassDao.batchRemove(positionSubclassIds);
	}
	
}
